Skip to content

Conversation

@Tay0108
Copy link

@Tay0108 Tay0108 commented Jan 22, 2026

Problem

Two issues prevented yarn workspace website start from working:

  1. Plugin Build Missing: doc-docusaurus-rfg-plugin was not compiled from TypeScript to JavaScript, so Docusaurus couldn't locate its entry point (lib/index.js)

  2. Server-Only Modules Bundled for Browser: The doc-docusaurus-typedoc-plugin depends on typedoc, which uses Node.js-only modules (child_process, inspector, module). These were being included in the client-side webpack bundle, causing resolution failures since browsers don't have access to Node APIs.

Solution

1. Build the Plugin

Run yarn workspace doc-docusaurus-rfg-plugin build to generate the compiled JavaScript entry point.

2. Exclude typedoc from Client Bundle

Added a custom Docusaurus plugin that configures webpack to exclude typedoc:

  • Prevents Node-only modules from being bundled for the browser
  • Avoids webpack resolution errors for child_process, module, inspector, etc.

3. Server-Only Plugin Inclusion

Conditionally include doc-docusaurus-typedoc-plugin only during server-side build:

  • Uses typeof window === 'undefined' to detect server vs. browser environment
  • Ensures plugin code never runs in the browser

4. Improved Type Safety

Refactored conditional plugin inclusion using spread operators to avoid TypeScript type errors with null values.

@Tay0108 Tay0108 marked this pull request as ready for review January 22, 2026 12:43
@5ZYSZ3K 5ZYSZ3K force-pushed the fix/webpack5 branch 3 times, most recently from 116bba5 to 1c048a1 Compare February 4, 2026 13:37
@Tay0108 Tay0108 force-pushed the fix/docusaurus-typedoc branch from cfc1493 to 609b996 Compare February 10, 2026 17:15
@5ZYSZ3K 5ZYSZ3K merged commit e0f54e9 into native-html:fix/webpack5 Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants